package com.mdata.controller;

import com.mdata.model.dto.UserDTO;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/test")
@RestController
public class TestController {

    @GetMapping("/getTest1")
    public Long getTest1(){
        return 1L;
    }
    @GetMapping("/getTest2")
    public Long getTest2(@RequestParam("name") String name, @RequestParam("age") String age){
        System.out.println(2+ name + age);
        return 2L;
    }
    @GetMapping("/getTest3")
    public Long getTest3(String name, String age){
        System.out.println(3+ name + age);
        return 3L;
    }
    @GetMapping("/getTest4/test44/test444")
    public Long getTest4(String name, String age){
        System.out.println(4+ name + age);
        return 4L;
    }
    @PostMapping("/postTest1")
    public Long postTest1(String name, String age){
        System.out.println(5+ name + age);
        return 5L;
    }
    @PostMapping("/postTest2")
    public Long postTest2(@RequestParam("name") String name, @RequestParam("age") String age){
        System.out.println(6+ name + age);
        return 6L;
    }
    @PostMapping("/postTest3/test44/test444")
    public Long postTest3(@RequestParam("name") String name, @RequestParam("age") String age){
        System.out.println(7+ name + age);
        return 7L;
    }
    @PostMapping("/postTest4/test44/test444")
    public Long postTest4(@RequestBody UserDTO userDTO){
        System.out.println(8+ userDTO.toString());
        return 8L;
    }
}
